<script>
export default {
  name: 'u-popup',
  data() {
    return {
    };
  },
  props: {
    show: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: '选择收益日期'
    },
    showTitle: {
      type: Boolean,
      default: true
    },
    position: {
      type: String,
      default: 'bottom'
    },
    showButton: {
      type: Boolean,
      default: true
    }
  },
};
</script>

<template>
  <van-popup
    :value="show"
    :position="position"
    @click-overlay="$emit('close')"
    round
  >
    <div v-if="showTitle" style="text-align: center;font-weight: bold;width: 100%;position:relative;margin-top: 26px;font-size: 36px">
      {{ title }}
      <van-icon @click="$emit('close')" name="cross" size="24" color="#222222" style="position: absolute;right: 32px"/>
    </div>
    <slot></slot>

    <div style="display: flex;justify-content: center" v-if="showButton">

      <van-button plain @click="$emit('close')" round type="info" style="width: 335px;height: 80px;margin: 16px">取消</van-button>
      <van-button @click="$emit('confirm')" round type="info" style="width: 335px;height: 80px;margin: 16px">确定</van-button>
    </div>

  </van-popup>
</template>

<style scoped lang="scss">

</style>
